﻿namespace HiMap.Geometry
{
    using System;

    public class PointClass : GeometryClass, IPoint, IGeometry
    {
        protected internal double _M;
        protected internal double _X;
        protected internal double _Y;
        protected internal double _Z;

        public PointClass()
        {
            base._Type = GeometryType.Point;
            this._X = 0;
            this._Y = 0;
            this._Z = 0;
            this._M = 0;
            base._Envelope = new EnvelopeClass();
        }

        IEnvelope IGeometry.Envlope
        {
            get
            {
                IEnvelope envelope = new EnvelopeClass();
                envelope.MinX = this._X;
                envelope.MaxX = this._X;
                envelope.MinY = this._Y;
                envelope.MaxY = this._Y;
                return envelope;
            }
        }

        double IPoint.M
        {
            get
            {
                return this._M;
            }
            set
            {
                this._M = value;
            }
        }

        double IPoint.X
        {
            get
            {
                return this._X;
            }
            set
            {
                this._X = value;
                base._Envelope.MinX = value;
                base._Envelope.MaxX = value;
            }
        }

        double IPoint.Y
        {
            get
            {
                return this._Y;
            }
            set
            {
                this._Y = value;
                base._Envelope.MinY = value;
                base._Envelope.MaxY = value;
            }
        }

        double IPoint.Z
        {
            get
            {
                return this._Z;
            }
            set
            {
                this._Z = value;
            }
        }
    }
}

